<template>
  <div class="first-funOne-container">
    <div class="first-funOne-box">
      <div class="first-funOne-button">
        <div
          v-for="(item, index) in buttonList"
          :key="index"
          @click="clickFunBtn(index)"
        >
          <div
            class="first-funOne-button-default"
            :class="item.active ? 'first-funOne-button-active' : ''"
          >
            {{ item.name }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      buttonStatus: false,
      buttonList: [
        { name: "园区", active: true },
        { name: "预警", active: false },
        { name: "楼层", active: false },
        { name: "消耗", active: false }
      ]
    };
  },
  created() {},
  mounted() {},
  computed: {},
  methods: {
    clickFunBtn(index) {
      this.buttonList.map((item) => {
        item.active = false;
        this.buttonList[index].active = true;
      });
    }
  },
  watch: {}
};
</script>

<style lang="scss">
.first-funOne-container {
  width: 100%;
  height: 100%;
  .first-funOne-box {
    height: 100%;
    width: 150%;
    background: url("../../../assets/img/FunctionArea/first_fun_one.png")
      no-repeat;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    .first-funOne-button {
      width: 120px;
      //   margin-top: -80px;
      box-sizing: border-box;
      display: flex;
      flex-direction: column;
      justify-content: space-evenly;
      height: 30%;
      .first-funOne-button-default {
        display: flex;
        justify-content: center;
        align-items: center;
        width: 100%;
        height: 43px;
        background: url("../../../assets/img/FunctionArea/fun_button_default.png")
          no-repeat;
        font-size: 18px;
      }
      .first-funOne-button-active {
        background: url("../../../assets/img/FunctionArea/fun_button_active.png")
          no-repeat;
      }
    }
  }
}
</style>
